var domContainer = document.querySelector('.container');
var domImgArea = document.querySelector('.container .imgarea');
var domIndicatorArea = document.querySelector('.container .indicatorarea');
var domPrev = document.querySelector('.container .prevarea .btnarea');
var domNext = document.querySelector('.container .nextarea .btnarea');

var imgArr = ['./img/Wallpaper1.jpg', './img/Wallpaper2.jpg', './img/Wallpaper3.jpg', './img/Wallpaper4.jpg', './img/Wallpaper5.jpg'];
var imgWidth = domImgArea.offsetWidth;

//初始化
function init() {
  loadBannerImg();
  load
}

function loadBannerImg() {
  var sHtml = '';
  for (var i = 0; i < imgArr.length; i++) {
    sHtml += `<img src="${imgArr[i]}" alt="" />`;
  }
  domImgArea.innerHTML = sHtml;
  domImgArea.style.width = imgArr.length * imgWidth + 'px';
}

init();
